package collection.enumTest;

/**
 * 利用枚举完成单例模式
 * @author lcx
 *
 */
public class SingletonEnumTest {
	
	public enum Single
	{
		SingleSon("xiaoming");
		
		private String name="";
		
		Single(String name)
		{
			this.name=name;
		}
		
		public static Single getInsance()
		{
			return SingleSon;
		}
	}
	
	public static void main(String[] args) {
		System.out.println(Single.getInsance().name);
	}

}
